#!/usr/bin/python
# -*- coding: utf-8 -*-

# # class Student(object):
# #     def __init__(self, name, score):
# #         self.__name = name
# #         self.__score = score
# #         # sam = Student('sam', 59)
# #         # sam.__name='lily'
# #         # print(sam.__name)
#
# class Person():
#     def __init__(self):
#         super(Person, self).__init__()
#         print("Person is here")
#
# class Teacher(Person):
#     def __init__(self):
#         super(Teacher, self).__init__()
#         print("Teacher is here")
#
#
#
# if __name__ == '__main__':
#     # w = People()
#     # w.add_height(10)
#     # w.add_weigth(2)
#     # w.start_strong()
#     # sam = Student('sam', 59)
#     # sam.__name='lily'
#     # print(sam.__name)
#
#     # t = Teacher()
#
#     ##### 元组
#     # name1 = ("yumoz", "cool") # tuple
#     # name2 = "yumoz", "cool"
#     # name3 = "yumoz"
#     # print(name1)
#     # print(name2)
#     # print(type(name1))
#     # print(type(name2))
#     # print(type(name3))

import copy
a = [1,2,3,[4,5],1]
b = a
c = copy.copy(a)
d = copy.deepcopy(a)

a.append(9)
a[3].append(6)

print(a) 	#[1, 2, 3, [4, 5, 6], 1, 9]
print(b)	#[1, 2, 3, [4, 5, 6], 1, 9]
print(c)	#[1, 2, 3, [4, 5, 6], 1]
print(d)	#[1, 2, 3, [4, 5], 1]

print(id(a))	#4594148288
print(id(b))	#4594148288
print(id(c))	#4594455328
print(id(d))	#4592688496


x = 'Hello World'
y = x
z = copy.copy(x)
w = copy.deepcopy(x)
print(id(x)) #4617118576
print(id(y)) #4617118576
print(id(z)) #4617118576
print(id(w)) #4617118576

# 对于不可变类型(元组、数值，字符串等)为浅拷贝,对象的id值与浅复制原来的值相同
# 对于可变类型(列表、字典等)为深拷贝，
